#include <iostream>
#include <vector>
#define AC 0
#define RUN_OK 140
#define TLE 150
#define MLE 152
#define WA 153
#define PE 154
#define SYS_ERROR 155
#define OLE 156
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n;i++) {
        cin >> v[i];
    }
    int x, y;
    cin >> x >> y;
    if (x < n && x >= 0 && y >= 0 && y < n && x != y) {
        if (v[x] == v[y]) {
            return AC;
        } else {
            return WA;
        }
    } else {
        return WA;
    }
    return AC;
}